package com.example.tests;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

import java.util.Set;

import org.testng.annotations.Test;

public class GroupModificationTests extends TestBase {

	@Test
	public void testFirstGroupCanBeModified() throws Exception {
		GroupObject validGroup2 = new GroupObject()
				.setName("qwer!@#$%^&*vfdsa").setHeader("rewqt23456789ewrtrew")
				.setFooter("ewrteQWERTYUIewtr");
		Set<GroupObject> oldList = app.getGroupHelper().getGroups();
		int numberOfGroupForModification = 2;
		app.getGroupHelper().modifyGroup(numberOfGroupForModification,
				validGroup2);
		// validate
		Set<GroupObject> newList = app.getGroupHelper().getGroups();
		verifyGroupEdited(oldList, validGroup2, newList);
	}

	private void verifyGroupEdited(Set<GroupObject> oldList,
			GroupObject someGroup, Set<GroupObject> newList) {
		assertThat(newList.size(), equalTo(oldList.size()));
		//	assertThat(newList, NOTequalTo(oldList));
	}

}
